package org.ct;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import org.ct.dataobjects.Course;
import org.ct.dataobjects.CourseGroup;
import org.ct.dataobjects.CourseType;
import org.ct.dataobjects.Student;
import org.ct.gui.core.AppFrame;
import org.hibernate.cfg.Configuration;

public class Application {
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException,
			IllegalAccessException, UnsupportedLookAndFeelException {

		// Set System L&F
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		Globals.application = new Application();
	}

	public Application() {
		configureHibernate();
		AppFrame appFrame = new AppFrame();
	}

	private void configureHibernate() {
		Configuration config = new Configuration();
		config.addAnnotatedClass(Student.class);
		config.addAnnotatedClass(Course.class);
		config.addAnnotatedClass(CourseGroup.class);
		config.addAnnotatedClass(CourseType.class);
		Globals.hibSessionFactory = config.configure().buildSessionFactory();
	}
}
